package com.springboot.autoconfigure.oss.config;

import com.springboot.autoconfigure.oss.annontion.RequiredFiled;
import com.springboot.autoconfigure.oss.service.impl.JdOssApiServiceImpl;
import com.springboot.autoconfigure.oss.service.impl.QiNiuOssApiServiceImpl;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

import javax.annotation.PostConstruct;

@Data
@Accessors(chain = true)
@Configuration
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@ConfigurationProperties(prefix = "oss.qiniu")
public class QiNiuOSSPropertis extends AbstractOSSPropertis {

    @RequiredFiled
    private String accessKey;
    @RequiredFiled
    private String secretKey;
    @RequiredFiled
    private String bucket;


    //字段用于文件下载
    private boolean useHttps;
    //字段用于文件下载
    private String domain;
    private String extranet;

    @Override
    public Class getImpl() {
        return QiNiuOssApiServiceImpl.class;
    }

}
